
//人事复核驳回
function renshifuhebohui() {
    //alert("进入了驳回程序！");

    layer.alert('您确定要驳回吗？', {
        skin: 'layui-layer-molv' //样式类名  自定义样式
        , closeBtn: 1    // 是否显示关闭按钮
        , anim: 1 //动画类型
        , icon: 6    // icon
        , btn: ['确定', '取消'] //按钮
        , area: ['300px', '180px']
        , yes: function () {
            let idd = $(".zhuazhi").val();
            let newidd = parseInt(idd);
            // let bohui = "驳回";
            let bohui = $(".bohuii").val();
            let javaA = {
                idd : newidd,
                bohui : bohui
            }
            console.log(javaA);
            $.ajaxSettings.async = false;
            $.get("/renshifuhebohui",javaA,function (dataA) {
                if (dataA == true) {
                    layer.msg("驳回成功！");
                    // alert("驳回成功!");
                    location.href = "/renshiwelcome";
                }else{
                    alert("驳回失败！");
                    return;
                }
            },"json")
            $.ajaxSettings.async = true;
        }
        , btn2: function () {
            layer.close();
        }
    });
}

//复核提交
$(function () {
    $("#shenhetongguoy").click(function () {
        layer.alert('您确定要提交吗？', {
            skin: 'layui-layer-molv' //样式类名  自定义样式
            , closeBtn: 1    // 是否显示关闭按钮
            , anim: 1 //动画类型
            , icon: 6    // icon
            , btn: ['确定', '取消'] //按钮
            , area: ['300px', '180px']
            , yes: function () {
                var formData = new FormData($('#from-fu')[0]);
                $.ajax({
                    type: 'post',
                    url: "/renshitijiaoa",
                    data: formData,
                    cache: false,
                    processData: false,
                    contentType: false,
                    success: function(dataA){
                        console.log(dataA);

                        if(dataA==true){
                            layer.msg("审核成功！");
                            // alert("审核成功！！！");
                            location.href="/renshiwelcome";
                        }else{
                            alert("审核失败，请联系管理员解决问题！！！")
                        }
                    }
                });
            }
            , btn2: function () {
                layer.close();
            }
        });
    });
});

//变更提交
$(function () {
    $("#msjkadfnbsadjfvugisd").click(function () {
        layer.alert('您确定要提交吗？', {
            skin: 'layui-layer-molv' //样式类名  自定义样式
            , closeBtn: 1    // 是否显示关闭按钮
            , anim: 1 //动画类型
            , icon: 6    // icon
            , btn: ['确定', '取消'] //按钮
            , area: ['300px', '180px']
            , yes: function () {
                var formData = new FormData($('#from-fu')[0]);
                $.ajax({
                    type: 'post',
                    url: "/renshibiangenga",
                    data: formData,
                    cache: false,
                    processData: false,
                    contentType: false,
                    success: function(dataA){
                        //console.log(dataA);

                        if(dataA==true){
                            // alert("变更成功！！！");
                            layer.msg("变更审核成功！");
                            location.href="/renshiwelcome";
                        }else{
                            alert("变更失败，请联系管理员解决问题！！！")
                        }
                    }
                });
            }
            , btn2: function () {
                layer.close();
            }
        });
    });
});


//变更审核中
function renshibiangengshenqing() {
    //alert("进入了变更程序！");
    layer.alert('您确定要变更吗？', {
        skin: 'layui-layer-molv' //样式类名  自定义样式
        , closeBtn: 1    // 是否显示关闭按钮
        , anim: 1 //动画类型
        , icon: 6    // icon
        , btn: ['确定', '取消'] //按钮
        , area: ['300px', '180px']
        , yes: function () {
            let idd = $(".zhuazhi").val();
            let newidd = parseInt(idd);
            let bohui = $(".biangengshenhe").val();
            let javaA = {
                idd : newidd,
                bohui : bohui
            }
            console.log(javaA);
            $.ajaxSettings.async = false;
            $.get("/renshishenhetongguo",javaA,function (dataA) {
                if (dataA == true) {
                    layer.msg("变更成功！");
                    //alert("变更成功!");
                    location.href = "/renshiwelcome";
                }else{
                    alert("变更失败！");
                    return;
                }
            },"json")
            $.ajaxSettings.async = true;
        }
        , btn2: function () {
            layer.close();
        }
    });
}


// 选择图片显示
function imgChange() {
    //获取点击的文本框
    var file =document.getElementById("file");
    var imgUrl =window.URL.createObjectURL(file.files[0]);
    var img =document.getElementById('imghead');
    img.setAttribute('src',imgUrl); // 修改img标签src属性值
};

function lookImg() {
    $("#img_a").remove();
    $("#show").show();
    var r= new FileReader();
    f=document.getElementById('file').files[0];
    r.readAsDataURL(f);
    r.onload=function (e) {
        document.getElementById('show').src=this.result;
    };
}

//判断照片大小
function getPhotoSize(obj){
    //文件type
    var photoExt = obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();
    if(!(photoExt=='.jpg'||photoExt=='.png'||photoExt=='.jpeg'||photoExt=='.gif')){
        alert("文件格式不符合要求！");
        document.getElementById('file').value='';
        return false;
    }
    var fileSize = 0;
    var isIE = /msie/i.test(navigator.userAgent) && !window.opera;
    if (isIE && !obj.files) {
        var filePath = obj.value;
        var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
        var file = fileSystem.GetFile (filePath);
        fileSize = file.Size;
    }
    else{
        fileSize = obj.files[0].size;
    }
    //文件大小
    fileSize=Math.round(fileSize/1024*100)/100;
    if(fileSize>=200){
        alert("图片过大，超过200k,请选择较小的图片");
        document.getElementById('file').value='';
        return false;
    }
    imgChange();
}



//人事复核提交
// function renshifuhetijiao() {
//     //抓值
//     let id = $(".zhuazhi").val();
//     let newidd = parseInt(id);//转换成int
//     let fileCoding = $(".fileCoding").val();//档案编码
//     let changeTheType = $(".changeTheType").val();//变更类型
//     // let department = $(".department").val();//所属部门
//     let fstatus = $(".fstatus").val();//档案状态
//     // let jobTitle = $(".jobTitle").val();//职位名称
//     let job = $(".jobTitle").val();//职位编码,int
//     if(job == "BDQN-BMO1"){
//         jobTitle = 1;
//     }else if(job == "BDQN-BMO2"){
//         jobTitle = 2
//     }else if(job == "BDQN-BMO3"){
//         jobTitle = 3
//     }else{
//         jobTitle = 1
//     }
//     let fjname = $(".fjname").val();//姓名
//     let fjsex = $(".fjsex").val();//性别
//     let fjemail = $(".fjemail").val();//EMAIL
//     let phone = $(".phone").val();//联系电话
//     let address = $(".address").val();//住址
//     let idNumber = $(".idNumber").val();//身份证号
//     let registered = $(".registered").val();//户口所在地
//     let politicsStatus = $(".politicsStatus").val();//政治面貌
//     let school = $(".school").val();//毕业院校
//     let major = $(".major").val();//专业
//     let education = $(".education").val();//学历
//     let salaary = $(".salaaryStandard").val();//薪酬标准,int
//     let salaaryStandard = parseInt(salaary);//转换成int
//     let openingBank = $(".openingBank").val();//开户行
//     let cardNo = $(".cardNo").val();//银行卡号
//     let social = $(".social").val();//社保卡号
//     let registrant = $(".registrant").val();//登记人
//     let filecreatedDate = $(".filecreatedDate").val();//建档时间
//     let redumes = $(".redumes").val();//个人履历
//     let family = $(".family").val();//家庭关系信息
//     let notes = $(".notes").val();//备注
//     let resumeAttachment = $(".resumeAttachment").val();//修改简历附件
//     let checkStatus = "审核通过";//修改状态
//
//     let javaA ={
//         id : newidd,
//         fileCoding : fileCoding,
//         changeTheType : changeTheType,
//         fstatus : fstatus,
//         jobTitle :jobTitle,
//         fjname :fjname,
//         fjsex : fjsex,
//         fjemail :fjemail,
//         phone :phone,
//         address : address,
//         idNumber :idNumber,
//         registered :registered,
//         politicsStatus :politicsStatus,
//         school : school,
//         major : major,
//         education :education,
//         salaaryStandard :salaaryStandard,
//         openingBank : openingBank,
//         cardNo : cardNo,
//         social : social,
//         registrant :registrant,
//         filecreatedDate : filecreatedDate,
//         redumes : redumes,
//         family : family,
//         notes : notes,
//         resumeAttachment : resumeAttachment,
//         checkStatus : checkStatus
//     }
//     console.log(javaA);
//     $.ajaxSettings.async = false;
//     $.get("/renshifuhebalcun",javaA,function (dataA) {
//         if (dataA == true){
//             alert("审核成功！");
//             location.href = "/renshiwelcome";
//         }else{
//             alert("审核失败！");
//             return;
//         }
//     },"json")
//     $.ajaxSettings.async = true;
// }